home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / IShield for Visual C++ 6.0 / DATA1.CAB / Include_Files / SDSEDT1.RUL < prev    next >
Encoding:
Text File  |  1997-11-20  |  4.9 KB  |  128 lines

  1.  
  2.  /*=======================================================================*/
  3.  /*                                                                       */
  4.  /*           (c) InstallShield Software Corporation (1996-1997)          */
  5.  /*            (c)  InstallShield Corporation  (1990-1996)                */
  6.  /*                       Schaumburg, Illinois 60173                      */
  7.  /*                          All Rights Reserved                          */
  8.  /*                           InstallShield (R)                           */
  9.  /*                                                                       */
  10.  /*   File    : sdsedt1.rul                                               */
  11.  /*                                                                       */
  12.  /*   Purpose : This file contains the code for the SdShowDlgEdit1        */
  13.  /*             script dialog function.                                   */
  14.  /*                                                                       */
  15.  /*=======================================================================*/
  16.  
  17.  /*------------------------------------------------------------------------*/
  18.  /*                                                                        */
  19.  /*   Function: SdShowDlgEdit1                                             */
  20.  /*                                                                        */
  21.  /*   Descrip:  This dialog will allow user one edit field for             */
  22.  /*             confirmation purpose.                                      */
  23.  /*   Misc:                                                                */
  24.  /*                                                                        */
  25.  /*------------------------------------------------------------------------*/
  26. function SdShowDlgEdit1(szTitle, szMsg, szField1, svEdit1 )
  27.           STRING  szDlg, szTemp;
  28.           NUMBER  nId, nMessage, nTemp;
  29.           HWND    hwndDlg;
  30.           BOOL    bDone;
  31.         begin
  32.  
  33.            szDlg     = SD_DLG_SHOWDLGEDIT1;
  34.            nSdDialog = SD_NDLG_SHOWDLGEDIT1;
  35.  
  36.           // record data produced by this dialog
  37.           if (MODE=SILENTMODE) then
  38.             SdMakeName( szAppKey, szDlg, szTitle, nSdShowDlgEdit1 );
  39.             SilentReadData( szAppKey, "Result", DATA_NUMBER, szTemp, nId );
  40.             if ((nId != BACK) && (nId != CANCEL)) then
  41.                SilentReadData( szAppKey, "szEdit1", DATA_STRING, svEdit1, nTemp );
  42.             endif;
  43.  
  44.             return nId;
  45.           endif;
  46.  
  47.  
  48.            // ensure general initialization is complete
  49.            if (!bSdInit) then
  50.                SdInit();
  51.            endif;
  52.  
  53.            if (EzDefineDialog( szDlg, "", "", SD_NDLG_SHOWDLGEDIT1 ) = DLG_ERR) then
  54.                return -1;
  55.            endif;
  56.  
  57.            // Loop in dialog until the user selects a standard button
  58.            bDone = FALSE;
  59.  
  60.            while (!bDone)
  61.  
  62.               nId = WaitOnDialog( szDlg );
  63.  
  64.               switch (nId)
  65.               case DLG_INIT:
  66.                    if( szMsg != "" ) then
  67.                        SdSetStatic(szDlg, SD_STA_MSG1, szMsg);
  68.                    endif;
  69.  
  70.                    if( szField1 != "" ) then
  71.                        SdSetStatic(szDlg, SD_STA_FIELD1, szField1 );
  72.                    endif;
  73.  
  74.                    CtrlSetText(szDlg, SD_EDIT1, svEdit1);
  75.  
  76.                    hwndDlg = CmdGetHwndDlg( szDlg );
  77.                    SdGeneralInit( szDlg, hwndDlg, STYLE_BOLD, szSdProduct );
  78.  
  79.                    if(szTitle != "") then
  80.                        SetWindowText(hwndDlg, szTitle);
  81.                    endif;
  82.  
  83.               case SD_EDIT1:
  84.                    nMessage = CtrlGetSubCommand(szDlg);
  85.  
  86.                    if(nMessage = EDITBOX_CHANGE) then
  87.                        CtrlGetText(szDlg, SD_EDIT1, svEdit1);
  88.                    endif;
  89.  
  90.               case SD_PBUT_OK:
  91.                    nId   = OK;
  92.                    bDone = TRUE;
  93.  
  94.               case BACK:
  95.                    nId    = BACK;
  96.                    bDone  = TRUE;
  97.  
  98.               case DLG_ERR:
  99.                    SdError( -1, "SdShowEdit1" );
  100.                    nId   = -1;
  101.                    bDone = TRUE;
  102.  
  103.               case DLG_CLOSE:
  104.                    SdCloseDlg( hwndDlg, nId, bDone );
  105.  
  106.               default:
  107.                    // check standard handling
  108.                    if (SdIsStdButton( nId ) && SdDoStdButton( nId )) then
  109.                       bDone = TRUE;
  110.                    endif;
  111.               endswitch;
  112.  
  113.            endwhile;
  114.  
  115.            EndDialog( szDlg );
  116.            ReleaseDialog( szDlg );
  117.  
  118.            SdUnInit( );
  119.  
  120.            // record data produced by this dialog
  121.            SdMakeName( szAppKey, szDlg, szTitle, nSdShowDlgEdit1 );
  122.            SilentWriteData( szAppKey, "szEdit1", DATA_STRING, svEdit1, 0 );
  123.            SilentWriteData( szAppKey, "Result", DATA_NUMBER, "", nId );
  124.  
  125.            return nId;
  126.  
  127.         end;
  128.